package Interceptor;

import response.ResponseBody;
import builder.ResponseBuilder;

public class ResponseInterceptor {
	
	private  ResponseInterceptor responseInterceptor;
	
	
	
	
	public ResponseInterceptor setResponseInterceptor(ResponseInterceptor responseInterceptor) {
		if(this.responseInterceptor==null)
		this.responseInterceptor = responseInterceptor;
		else this.responseInterceptor.setResponseInterceptor(responseInterceptor);
		return responseInterceptor;
	}

	public ResponseBuilder interceptor(ResponseBuilder builder) throws Exception {
		if (responseInterceptor != null) {
			builder= responseInterceptor.interceptor(builder);
 		 }
 
		
		return interceptorAction(builder);
	}
	
	public  ResponseBuilder interceptorAction(ResponseBuilder builder) throws Exception{
		
		return builder;
	}
	
	
}
